import React, { Component } from 'react';
import { Scroller, Touchable } from '$yo-component';
import Header from '$component/header/index.js';
import yoHistory from '$common/history';
import { Router, Route, IndexRoute, Link } from '$router';

import Carousel from 'yo3/component/carousel';
import './index.scss';
require('es6-promise').polyfill();
require('isomorphic-fetch');

var HomePage = React.createClass( {
    getDefaultProps:function(){
        return {
            aa:"aa"
        }
    },
    getInitialState:function(){
        return {
            tab:"技能"
        }
    },
    componentWillMount:function(){
        //请求数据
        var self = this;
        

        switch(this.props.params.sel){
            case "1" :
                //技能页面
                console.log("1");
                this.setState({
                    tab:"技能"
                })
            break;
            case "2" :
                //项目页面
                console.log("2");
                this.setState({
                    tab:"项目"
                })
            break;
            case "3" :
                //经历页面
                console.log("3");
                this.setState({
                    tab:"经历"
                })
            break;
            case "4" :
                //我的页面
                console.log("4");
                this.setState({
                    tab:"我的"
                })
            break;
            default:
                //显示技能页面
                console.log("1");
                this.setState({
                    tab:"技能"
                })
        }
    },
    render:function() {
        return (
            <div className="yo-flex">
                <Header title={this.state.tab}/>
                    
                    {this.props.children}
                        {/* <Carousel>
                        <li className="item"><img className="img" src="//img1.qunarzz.com/qs/1610/a6/01d1ad00e4b9e102.jpg" /></li>  
                        <li className="item"><img className="img" src="//img1.qunarzz.com/qs/1610/a6/01d1ad00e4b9e102.jpg" /></li>  
                        <li className="item"><img className="img" src="//img1.qunarzz.com/qs/1610/a6/01d1ad00e4b9e102.jpg" /></li>  
                    </Carousel> */}
                    {/* <p className="title">Hello World!</p>
                    <p className="notice">Try To Tap This Area!</p> */}
                        
                
                <ul className="yo-tab yo-tab-view" style={{paddingBottom:.3+'rem'}}>
                    <li className="item item-y-ico">    
                        <Link to="/skill/1" className="footTab" activeClassName="activeTab">  <i className="yo-ico"></i>技能</Link>
                    </li>
                    <li className="item item-y-ico">
                        <Link to="/obj" className="footTab" activeClassName="activeTab" > <i className="yo-ico"></i>项目</Link>
                    </li>
                    <li className="item item-y-ico">
                        <Link to="/expire" className="footTab" activeClassName="activeTab"> <i className="yo-ico"></i>经历</Link>
                    </li>
                    <li className="item item-y-ico">
                        <Link to="/my/4" className="footTab" activeClassName="activeTab"> <i className="yo-ico"></i>我的</Link>
                    </li>
                </ul>
            </div>
        )
    }
})

export default HomePage;
